package com.itheima.多态.多条的好处_04;
//动物类  -- 父类
public abstract class Animal {

    public abstract void eat();
}
class Dog extends Animal{

    @Override
    public void eat() {
        System.out.println("狗吃肉");
    }
}
class Cat extends Animal{

    @Override
    public void eat() {
        System.out.println("猫吃鱼");
    }
}
class Pig extends Animal{

    @Override
    public void eat() {
        System.out.println("猪吃白菜");
    }
}